<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
		xmlns:ice="http://www.icesoft.com/icefaces/component"  
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
    
    <ice:form id="listfacilityFormId" styleClass="edit">
      <ice:panelGroup  id="searchGroup" styleClass="formBorderHighlight">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                  <td class="iceDatTblColHdr2">
                    <ice:outputText id="listFacilityId" value="Facility search"/>
                 </td>
              </tr>
         </table>	
         <ice:panelGroup id="listPanelGroupFacilityId" styleClass="edit">
		
            <s:decorate id="addressdecId" template="layout/display.xhtml">
                <ui:define name="label">address</ui:define>
                <ice:inputText id="listaddressTextId" 
                          value="#{facilityList.facility.address}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="citydecId" template="layout/display.xhtml">
                <ui:define name="label">city</ui:define>
                <ice:inputText id="listcityTextId" 
                          value="#{facilityList.facility.city}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="countrydecId" template="layout/display.xhtml">
                <ui:define name="label">country</ui:define>
                <ice:inputText id="listcountryTextId" 
                          value="#{facilityList.facility.country}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="countydecId" template="layout/display.xhtml">
                <ui:define name="label">county</ui:define>
                <ice:inputText id="listcountyTextId" 
                          value="#{facilityList.facility.county}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="descriptiondecId" template="layout/display.xhtml">
                <ui:define name="label">description</ui:define>
                <ice:inputText id="listdescriptionTextId" 
                          value="#{facilityList.facility.description}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="namedecId" template="layout/display.xhtml">
                <ui:define name="label">name</ui:define>
                <ice:inputText id="listnameTextId" 
                          value="#{facilityList.facility.name}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="phonedecId" template="layout/display.xhtml">
                <ui:define name="label">phone</ui:define>
                <ice:inputText id="listphoneTextId" 
                          value="#{facilityList.facility.phone}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="statedecId" template="layout/display.xhtml">
                <ui:define name="label">state</ui:define>
                <ice:inputText id="liststateTextId" 
                          value="#{facilityList.facility.state}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="typedecId" template="layout/display.xhtml">
                <ui:define name="label">type</ui:define>
                <ice:inputText id="listtypeTextId" 
                          value="#{facilityList.facility.type}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="uridecId" template="layout/display.xhtml">
                <ui:define name="label">uri</ui:define>
                <ice:inputText id="listuriTextId" 
                          value="#{facilityList.facility.uri}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="zipdecId" template="layout/display.xhtml">
                <ui:define name="label">zip</ui:define>
                <ice:inputText id="listzipTextId" 
                          value="#{facilityList.facility.zip}"
				  partialSubmit="true"/>
            </s:decorate>

          
   
	  </ice:panelGroup>
  
        
        <div class="actionButtons">
            <ice:commandButton id="listSearchButtonId" value="Search" action="/FacilityList.xhtml"/>
        </div>
      </ice:panelGroup> 
    </ice:form>
    
    <ice:panelGroup styleClass="formBorderHighlight">

    <h3>facility  search results</h3>

    <div class="searchResults" id="listfacilityResults">
    <ice:outputText value="The facility search returned no results." 
               rendered="#{empty facilityList.resultList}"/>
               
    <ice:dataTable id="facilityListTableId" 
                  var="facility"
                value="#{facilityList.resultList}" 
            resizable="true"
        columnClasses="allCols"
             rendered="#{not empty facilityList.resultList}">
        <ice:column id="listidId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listidLinkId"
                             value="id #{facilityList.order=='id asc' ? messages.down : ( facilityList.order=='id desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='id asc' ? 'id desc' : 'id asc'}"/>
                </s:link>
            </f:facet>
            #{facility.id}&amp;nbsp;
        </ice:column>
        <ice:column id="listaddressId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listaddressLinkId"
                             value="address #{facilityList.order=='address asc' ? messages.down : ( facilityList.order=='address desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='address asc' ? 'address desc' : 'address asc'}"/>
                </s:link>
            </f:facet>
            #{facility.address}&amp;nbsp;
        </ice:column>
        <ice:column id="listcityId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listcityLinkId"
                             value="city #{facilityList.order=='city asc' ? messages.down : ( facilityList.order=='city desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='city asc' ? 'city desc' : 'city asc'}"/>
                </s:link>
            </f:facet>
            #{facility.city}&amp;nbsp;
        </ice:column>
        <ice:column id="listcountryId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listcountryLinkId"
                             value="country #{facilityList.order=='country asc' ? messages.down : ( facilityList.order=='country desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='country asc' ? 'country desc' : 'country asc'}"/>
                </s:link>
            </f:facet>
            #{facility.country}&amp;nbsp;
        </ice:column>
        <ice:column id="listcountyId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listcountyLinkId"
                             value="county #{facilityList.order=='county asc' ? messages.down : ( facilityList.order=='county desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='county asc' ? 'county desc' : 'county asc'}"/>
                </s:link>
            </f:facet>
            #{facility.county}&amp;nbsp;
        </ice:column>
        <ice:column id="listdescriptionId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listdescriptionLinkId"
                             value="description #{facilityList.order=='description asc' ? messages.down : ( facilityList.order=='description desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='description asc' ? 'description desc' : 'description asc'}"/>
                </s:link>
            </f:facet>
            #{facility.description}&amp;nbsp;
        </ice:column>
        <ice:column id="listnameId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listnameLinkId"
                             value="name #{facilityList.order=='name asc' ? messages.down : ( facilityList.order=='name desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='name asc' ? 'name desc' : 'name asc'}"/>
                </s:link>
            </f:facet>
            #{facility.name}&amp;nbsp;
        </ice:column>
        <ice:column id="listphoneId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listphoneLinkId"
                             value="phone #{facilityList.order=='phone asc' ? messages.down : ( facilityList.order=='phone desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='phone asc' ? 'phone desc' : 'phone asc'}"/>
                </s:link>
            </f:facet>
            #{facility.phone}&amp;nbsp;
        </ice:column>
        <ice:column id="listpriceRangeId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listpriceRangeLinkId"
                             value="priceRange #{facilityList.order=='priceRange asc' ? messages.down : ( facilityList.order=='priceRange desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='priceRange asc' ? 'priceRange desc' : 'priceRange asc'}"/>
                </s:link>
            </f:facet>
            #{facility.priceRange}&amp;nbsp;
        </ice:column>
        <ice:column id="liststateId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="liststateLinkId"
                             value="state #{facilityList.order=='state asc' ? messages.down : ( facilityList.order=='state desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='state asc' ? 'state desc' : 'state asc'}"/>
                </s:link>
            </f:facet>
            #{facility.state}&amp;nbsp;
        </ice:column>
        <ice:column id="listtypeId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listtypeLinkId"
                             value="type #{facilityList.order=='type asc' ? messages.down : ( facilityList.order=='type desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='type asc' ? 'type desc' : 'type asc'}"/>
                </s:link>
            </f:facet>
            #{facility.type}&amp;nbsp;
        </ice:column>
        <ice:column id="listuriId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listuriLinkId"
                             value="uri #{facilityList.order=='uri asc' ? messages.down : ( facilityList.order=='uri desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='uri asc' ? 'uri desc' : 'uri asc'}"/>
                </s:link>
            </f:facet>
            #{facility.uri}&amp;nbsp;
        </ice:column>
        <ice:column id="listzipId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listzipLinkId"
                             value="zip #{facilityList.order=='zip asc' ? messages.down : ( facilityList.order=='zip desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{facilityList.order=='zip asc' ? 'zip desc' : 'zip asc'}"/>
                </s:link>
            </f:facet>
            #{facility.zip}&amp;nbsp;
        </ice:column>
        <ice:column id="listColumnFacilityId">
            <f:facet name="header">action</f:facet>
            <s:link view="/#{empty from ? 'Facility' : from}.xhtml" 
                   value="Select" 
                      id="listfacilityLinkId">
                <f:param name="facilityId" 
                        value="#{facility.id}"/>
            </s:link>
        </ice:column>
    </ice:dataTable>

    </div>
</ice:panelGroup>

    <div class="tableControl">
      
        <s:link view="/FacilityList.xhtml" 
            rendered="#{facilityList.previousExists}" 
               value="#{messages.left}#{messages.left} First Page"
                  id="firstPagefacilityListId">
          <f:param name="firstResult" value="0"/>
        </s:link>
        
        <s:link view="/FacilityList.xhtml" 
            rendered="#{facilityList.previousExists}" 
               value="#{messages.left} Previous Page"
                  id="previousPagefacilityListId">
            <f:param name="firstResult" 
                    value="#{facilityList.previousFirstResult}"/>
        </s:link>
        
        <s:link view="/FacilityList.xhtml" 
            rendered="#{facilityList.nextExists}" 
               value="Next Page #{messages.right}"
                  id="nextPagefacilityListId">
            <f:param name="firstResult" 
                    value="#{facilityList.nextFirstResult}"/>
        </s:link>
        
        <s:link view="/FacilityList.xhtml" 
            rendered="#{facilityList.nextExists}" 
               value="Last Page #{messages.right}#{messages.right}"
                  id="lastPagefacilityListId">
            <f:param name="firstResult" 
                    value="#{facilityList.lastFirstResult}"/>
        </s:link>
        
    </div>
    
    <s:div styleClass="actionButtons" rendered="#{empty from}">
        <s:button view="/FacilityEdit.xhtml"
                    id="listCreatefacilityId" 
                 value="Create facility">
            <f:param name="facilityId"/>
        </s:button>
    </s:div>
    
</ui:define>

</ui:composition>

